﻿//=====================================================================================================
// LocalizationLibrary
// The Localization Library is a collection of reusable software components that provide 
// support for localization. This library enables you to localize WPF, Silverlight and WP7 applications.
// (http://localizationlibrary.codeplex.com)
//=====================================================================================================
// Author: Nicola Gallo (Website: www.nicola.gallo.name, Email: nicolagmt@hotmail.it) 
//=====================================================================================================

namespace HelloWorld.Startup.ViewModels
{
    //.NET References
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.Composition;
    using System.Linq;
    using System.Text;

    //HelloWorld References
    using HelloWorld.Startup.Constants;
    using HelloWorld.Startup.MVVM;

    //LocalizationLibrary References
    using LocalizationLibrary;
    using LocalizationLibrary.Attributes;
    
    // Microsoft References
    using Microsoft.Practices.Composite.Presentation.Commands;

    /// <summary>
    /// Defines a static localization's <see cref="ViewModel"/>
    /// </summary>
    [Export("VMDynamicLocalizationComposition", typeof(IViewModel))]
    public class DynamicLocalizationVM : ViewModel
    {
        //Constructors

        /// <summary>
        /// Default constructor.
        /// </summary>
        public DynamicLocalizationVM()
        {
            LocalizationManager.RegisterLocalizationModel(this);
        }

        //Properties

        /// <summary>
        /// Gets/Sets the firstname. It is a localized property.
        /// </summary>
        [LocalizeDynamically(LocalizationKey.Firstname)]
        [LocalizeDynamically(Language = "en", Value = "First Name")] 
        [LocalizeDynamically(Language = "it", Value = "Nome")] 
        public String Firstname { get; set; }

        /// <summary>
        /// Gets/Sets the secondname. It is a localized property.
        /// </summary>
        [LocalizeDynamically(LocalizationKey.Lastname)]
        [LocalizeDynamically(Language = "en", Value = "Last Name")]
        [LocalizeDynamically(Language = "it", Value = "Cognome")]
        public String Lastname { get; set; }

        /// <summary>
        /// Gets/Sets the address. It is a localized property.
        /// </summary>
        [LocalizeDynamically(LocalizationKey.Address)]
        [LocalizeDynamically(Language = "en", Value = "Address")]
        [LocalizeDynamically(Language = "it", Value = "Indirizzo")]
        public String Address { get; set; }

        /// <summary>
        /// Gets/Sets the town. It is a localized property.
        /// </summary>
        [LocalizeDynamically(LocalizationKey.Town)]
        [LocalizeDynamically(Language = "en", Value = "Town")]
        [LocalizeDynamically(Language = "it", Value = "Città")]
        public String Town { get; set; }

        /// <summary>
        /// Gets/Sets the postcode. It is a localized property.
        /// </summary>
        [LocalizeDynamically(LocalizationKey.Postcode)]
        [LocalizeDynamically(Language = "en", Value = "Postcode")]
        [LocalizeDynamically(Language = "it", Value = "Codice postale")]
        public String Postcode { get; set; }

        /// <summary>
        /// Gets/Sets the birthday. It is a localized property.
        /// </summary>
        [LocalizeDynamically(LocalizationKey.Birthday)]
        [LocalizeDynamically(Language = "en", Value = "Birthday")]
        [LocalizeDynamically(Language = "it", Value = "Compleanno")]
        public String Birthday { get; set; }
    }
}
